<template>
	<view v-for="item,index in list" class="list">
		<view class="badge" v-if="item.state==0"></view>
		<view class="list_right3">
			<view class="title">
				<image class="l_img" :src="item.fromHeadUrl"></image>
				<view class="center">
					<view class="name">
						<!-- <text>昵称昵称</text><text>赞了你的文章</text> -->
						<text>{{item.title}}</text>
					</view>
					<view class="time">{{formatTimestamp(item.createdAt)}}</view>
				</view>
			</view>
			<view class="msg_con">
				<view>
					<image src="/static/logo.png" mode=""></image>
				</view>
				<view class="text">{{item.content}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		defineProps
	} from 'vue';
	import {formatTimestamp} from '@/utils/time.js';
	let props = defineProps(['list'])
</script>

<style lang="scss">
	.list {
		background-color: #292B2A;
		border-radius: 10rpx;
		display: flex;
		padding: 32rpx;
		margin-bottom: 24rpx;
		position: relative;
	}

	.badge {
		position: absolute;
		width: 20rpx;
		height: 20rpx;
		background-color: #FF4C5A;
		border-radius: 50%;
		right: 0rpx;
		top: 0rpx;
	}



	.list_right3 {
		width: 100%;

		.l_img {
			width: 88rpx;
			height: 88rpx;
			margin-right: 24rpx;
			border-radius: 50%;
		}


		.title {
			font-size: 28rpx;
			color: #fff;
			margin-bottom: 16rpx;
			display: flex;

			.center {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
			}


		}

		.msg_con {
			margin-top: 24rpx;
			background-color: #444444;
			display: flex;
			height: 96rpx;

			image {
				width: 96rpx !important;
				height: 96rpx !important;
				border-radius: 0 !important;
			}

			.text {
				height: 50rpx;
				padding: 14rpx 22rpx 14rpx 0rpx;
				color: #F5F5F5;
				font-size: 24rpx;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				text-overflow: ellipsis;
				overflow: hidden
			}
		}

		.name {
			font-size: 28rpx;
			color: #fff;

			text {
				padding-right: 8rpx;
			}
		}

		.time {
			font-size: 24rpx;
			color: #999999;
		}
	}
</style>